#ifndef __CONTEXT_H__
#define __CONTEXT_H__

#include <types.h>

typedef struct {
    uintptr_t ra;
    uintptr_t sp;
    uintptr_t gp;
    uintptr_t tp;
    uintptr_t t0;
    uintptr_t t1;
    uintptr_t t2;
    uintptr_t s0;
    uintptr_t s1;
    uintptr_t a0;
    uintptr_t a1;
    uintptr_t a2;
    uintptr_t a3;
    uintptr_t a4;
    uintptr_t a5;
    uintptr_t a6;
    uintptr_t a7;
    uintptr_t s2;
    uintptr_t s3;
    uintptr_t s4;
    uintptr_t s5;
    uintptr_t s6;
    uintptr_t s7;
    uintptr_t s8;
    uintptr_t s9;
    uintptr_t s10;
    uintptr_t s11;
    uintptr_t t3;
    uintptr_t t4;
    uintptr_t t5;
    uintptr_t t6;
} context_t;

typedef struct {
    context_t context;
    uintptr_t sstatus;
    uintptr_t sepc;
    uintptr_t stval;
    uintptr_t scause;
} trapframe_t;


void sched_init(void);
int task_create(void (*proc_fn)(void));
void task_yield(void);

#endif /* !__CONTEXT_H__ */